package org.example;

import org.junit.Test;

import java.util.Objects;
import java.util.concurrent.*;

public class DemoTest7 {
    @Test
    public void testWhenCompleteExceptionally() throws ExecutionException, InterruptedException {
        CompletableFuture<Double> future = CompletableFuture.supplyAsync(() -> {
            if (1 == 1) {
                throw new RuntimeException("出错了");
            }
            return 0.11;
        });

        //如果不加  get()方法这一行，看不到异常信息
//        future.get();
    }
}
